package cn.edu.zafu.bigdata.x.huangxihao202211080211;

class Animal{
    public void makeSound(){
        System.out.println("Animal sound");
    }
}

class Dog extends Animal{
    @Override
    public void makeSound(){
        System.out.println("Woof!");
    }
}

class Cat extends Animal{
    @Override
    public void makeSound(){
        System.out.println("Meow!");
    }
}

public class ClassInheritance {
    public static void main(String[] args){
        Dog dog=new Dog();
        dog.makeSound();
        Cat cat=new Cat();
        cat.makeSound();
    }
}